<?php

namespace app\api\controller;

use tmcore\base\BaseController;
use think\App;

class ApiController extends BaseController
{
    /**
     * 用户id
     */
    protected $userId = 0;

    /**
     * 用户信息
     */
    protected $userInfo;

    /**
     * 初始化方法
     * @return bool|mixed
     */
    public function initialize()
    {
        if (isset($this->request->userInfo) && $this->request->userInfo) {
            $this->userInfo = $this->request->userInfo;
            $this->userId = $this->request->userInfo['id'];
        }
    }
}